package com.taxi.daos.mysql;

import java.io.IOException;
import java.io.Reader;
import java.util.List;

import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;
import com.taxi.bean.SectorDTO;
import com.taxi.daos.interfaces.SectorDAO;
import com.sun.org.apache.bcel.internal.generic.LSTORE;

public class SectorDAOImpl implements SectorDAO {

	private static Reader reader;
	private static SqlMapClient sqlMap;
	
	static{
		try {
			reader = Resources.getResourceAsReader("ConfiguracionIbatis.xml");
			sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	@Override
	public List<SectorDTO> cargarSector() throws Exception {
		// TODO Auto-generated method stub
		
		List<SectorDTO> lstSector=sqlMap.queryForList("cargarSectores");
		
		return lstSector;
	}

}
